package com.gitee.wsl.common.ui.draw.style

import androidx.compose.ui.graphics.PathEffect
import androidx.compose.ui.graphics.drawscope.Stroke
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.dp


internal typealias StrokeWidth = Float

internal fun StrokeWidth.toStroke(density: Density): Stroke =
    with(density) {
        Stroke(width = dp.toPx())
    }


val Stroke.Companion.line1 get() = Stroke(width = 1f)

val Stroke.Companion.line2 get() = Stroke(width = 2f)

val Stroke.Companion.line3 get() = Stroke(width = 3f)

val Stroke.Companion.dash2 get() = Stroke(width = 2f, pathEffect = PathEffect.dashPathEffect(floatArrayOf(2f, 2f)))

val Stroke.Companion.dash5 get() = Stroke(width = 2f, pathEffect = PathEffect.dashPathEffect(floatArrayOf(5f, 5f)))

val Stroke.Companion.dash10 get() = Stroke(width = 2f, pathEffect = PathEffect.dashPathEffect(floatArrayOf(10f, 10f)))

val Stroke.Companion.dash20 get() = Stroke(width = 2f, pathEffect = PathEffect.dashPathEffect(floatArrayOf(20f, 20f)))

val Stroke.Companion.dash20_10 get() = Stroke(width = 2f, pathEffect = PathEffect.dashPathEffect(floatArrayOf(20f, 10f)))